package com.zmc.lostfound.post.vo;

import com.zmc.lostfound.common.valid.AddGroup;
import com.zmc.lostfound.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author WJS
 * @description 物品类型新增/修改请求体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("物品类型新增/修改请求体")
public class ItemTypeSaveVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ApiModelProperty("物品类型id")
    @Null(message = "新增物品类型: 物品类型id必须为空", groups = {AddGroup.class})
    @NotNull(message = "修改物品类型: 物品类型id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "修改物品类型: 物品类型id必须大于等于1", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 物品类型
     */
    @ApiModelProperty("物品类型")
    @NotBlank(message = "新增物品类型: 物品类型不能为空", groups = {AddGroup.class})
    private String type;

}
